package com.aaron.javaSPI;

import com.aaron.javaSPI.impl.Robot;

import java.util.ServiceLoader;

/**
 * @ClassName JavaSPITest
 * @description:
 * @author: 荣燊
 * @create: 2021-08-19 12:15
 **/
public class JavaSPITest {
    public static void main(String[] args) {
        ServiceLoader<Robot> serviceLoader = ServiceLoader.load(Robot.class);
        System.out.println("Java SPI");
        serviceLoader.forEach(Robot::sayHello);
    }
}
